@extends('system.frame_layout')
<?php $parent_menu = "购物商城"; $menu_selected = "我的订单";?>

@section('content')
    <div id="content-panel">
        <div class="row">
            <div class="col-xs-12">
                <div class="portlet light bordered">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="icon-social-dribbble font-dark hide"></i>
                            <span class="caption-subject font-dark bold">我的订单 My Orders</span>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <table class="table table-hover table-responsive">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>商品数量</th>
                                <th>订单金额</th>
                                <th>商品编号</th>
                                <th>收货地址</th>
                                <th>联系方式</th>
                                <th>订单备注</th>
                                <th>订单状态</th>
                                <th>物流信息</th>
                                <th>下单时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($orders as $o)
                                <tr>
                                    <td>{{$o->no}}</td>
                                    <td>{{$o->num}}</td>
                                    <td>{{$o->price}}</td>
                                    <td>
                                        <a href="{{route('sys.products')}}" style="color: darkseagreen;">
                                            {{$o->good_no}}
                                        </a>
                                    </td>
                                    <td>{{$o->addr}}</td>
                                    <td>{{$o->tel}}</td>
                                    <td>{{$o->detail}}</td>
                                    <td>
                                        @if($o->status == \App\Models\MOrder::$STATUS_PAY_OK)
                                            待发货
                                        @elseif($o->status == \App\Models\MOrder::$STATUS_PAY_SEND)
                                            已发货
                                        @elseif($o->status == \App\Models\MOrder::$STATUS_PAY_END)
                                            已完结
                                        @endif
                                    </td>
                                    <td>
                                        @if($o->status != \App\Models\MOrder::$STATUS_PAY_OK)
                                            <a onclick="getData({{$o->id}})" style="color: #5BC0DE;cursor: pointer">查看物流</a>
                                        @else
                                            无
                                        @endif
                                    </td>
                                    <td>
                                        {{date('Y-m-d H:i:s',$o->time)}}
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        @include('system.coms.fenye')
                    </div>
                </div>
            </div>
        </div>
    </div>
    @include('system.coms.express-info-dialog')
@endsection

@section('footer')
@endsection